package com.nsfocus.jdbc;

import com.sun.org.apache.xpath.internal.SourceTree;

import java.sql.Connection;
import java.sql.Driver;
import java.sql.DriverManager;

/**
 * @File: JdbcDemo.java
 * @User: Liangkangkang
 * @Date: 17-4-25
 * @Time: 下午3:14
 * @Mail: liangkangkang@yahoo.com
 * @Desc:
 * @Version:
 */

public class JdbcDemo {
    public static void main(String[] args) {
//        String dirver = "com.mysql.jdbc.Driver";
        try {
//            Class.forName("com.mysql.jdbc.Driver");
//            String url = "jdbc:mysql://localhost:3306/mysql";
//            String username = "root";
//            String password = "12345";
            // connect
//            Connection conn = DriverManager.getConnection(url,username,password);
            Class.forName("com.mysql.jdbc.Driver");
            String url = "jdbc:mysql://localhost:3306/lkk";
            String username = "root";
            String password = "12345";
            Connection conn = DriverManager.getConnection(url,username,password);
            System.out.println("-----");
            System.out.println(conn);
        } catch (Exception e) {
            e.printStackTrace();
        }
        Class clazz = Int.class;
    }
}
